home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3401 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  982 b 

  1. Path: news.mindlink.net!news
  2. From: genew@mindlink.bc.ca (Gene Wirchenko)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: strings
  5. Date: Sun, 28 Jan 1996 18:51:11 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4egglq$d3g@fountain.mindlink.net>
  8. References: <4eg9qj$1ut4@sp115.ocs.lsu.edu>
  9. NNTP-Posting-Host: line179.nwm.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. eenaya@unix1.sncc.lsu.edu (Pradeep Nayar) wrote:
  13.  
  14. >Hi,
  15. >I saw this piece of code in a book somewhere.  
  16.  
  17. >----
  18. >char *str ;
  19.  
  20. >str = "hello world"[10] ;
  21.  
  22. >_________
  23.  
  24. >what does the second line do?
  25.  
  26.      It condemns the programmer's soul to the Hell of obfuscated code
  27. <G>.
  28.  
  29.      "hello world" is a pointer.  [10] indexes 10 chars past "h" (the
  30. start): to the "d".
  31.  
  32.      In plain language:
  33.  
  34.           char str;
  35.           str='d';
  36.  
  37. >Pradeep Nayar
  38.  
  39. Sincerely,
  40.  
  41. Gene Wirchenko
  42.  
  43. C Pronunciation Guide:
  44.      y=x++;     "wye equals ex plus plus semicolon"
  45.      x=x++;     "ex equals ex doublecross semicolon"
  46.  
  47.